package com.net.xpay.core.enums;

import com.net.common.enums.base.StringEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
 * 2020/5/7 16:46

 */
@Slf4j
@Getter
@AllArgsConstructor
public enum AutoPayOrderStatus implements StringEnum<AutoPayOrderStatus> {
    IMPORTED("IMPORTED", "已导入"),  //导入但是得经确认后才能被转出
    ENSURED("ENSURED", "待转账"),           //已被确认 可以转出
    WAIT_PAY("WAIT_PAY", "待付款"),
    DEALING("DEALING", "处理中"),
    SUCCESS("SUCCESS", "成功"),
    FAIL("FAIL", "失败"),
    DISUSE("DISUSE", "已废除"),
    UNKNOWN("UNKNOWN", "未知")
    ;

    public static AutoPayOrderStatus of(String status) {
        try {
            return AutoPayOrderStatus.valueOf(status);
        } catch (Exception e) {
            log.error("of error|status={}", status);
            return UNKNOWN;
        }
    }

    private String value;

    private String desc;
}
